package com.dragon.geekbang.thinking.in.spring.ioc.container.overview.domain.repository;

import com.dragon.geekbang.thinking.in.spring.ioc.container.overview.domain.User;
import lombok.Data;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.core.io.ResourceLoader;

import java.util.Collection;

/**
 * 用户仓库
 * 依赖注入
 */
@Data
public class UserRepository {

    // 自定义的Bean
    private Collection<User> users;

    // 内建的非Bean对象（依赖）
    private BeanFactory beanFactory;
    private ResourceLoader resourceLoader;
    private ApplicationEventPublisher applicationEventPublisher;

    // 延迟注入
    private ObjectFactory<User> userObjectFactory;
    private ObjectFactory<ApplicationContext> applicationContextObjectFactory;


}
